package javamobile.util;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Utilities {
	static public <T> boolean checkDuplicate (T[] a) {
		List<T> inputList = Arrays.asList(a);
		Set<T> inputSet = new HashSet<T>(inputList);
		if (inputSet.size() < inputList.size())
			return false; // invalid Array
		return true;
	}
	
	public static String translateToMonth (int month) {
		String[] months = {
				"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "Wrong input month"
		};
		if (month<12) {
			return months[month];
		}
		else
			return months[12];
	}
}
